{{ if .Site.Params.widgets.categories }}
{{ if isset .Site.Taxonomies "categories" }}
{{ if not (eq (len .Site.Taxonomies.categories) 0) }}
<div class="widget-wrap">
    <h3 class="widget-title">{{with .Site.Data.l10n.widgets.categories.title}}{{.}}{{end}}</h3>
    <div class="widget">
        <ul class="category-list">
            {{ range $name, $items := .Site.Taxonomies.categories }}
            <li class="category-list-item">
                {{ $url := printf "%s/%s" "categories" ($name | urlize | lower)}}
                <a class="category-list-link" href="{{ $url | absURL }}">
                    {{ $name }}
                </a>
                <span class="category-list-count">{{ len $items }}</span>
            </li>
            {{ end }}
        </ul>
    </div>
</div>
{{ end }}
{{ end }}
{{ end }}
